package com.codi.bus.core.service.model;

import com.codi.base.util.DateUtils;
import com.codi.base.util.MoneyUtils;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by asus on 2017/11/8.
 */
@Data
@Accessors(chain = true)

public class ShareDetailTotalModel {

    private String fundCode; //	C6	基金代码

    private String portfolioCode; //	C4	投资组合编码

    private BigDecimal enableShares; //	N16.2	可用份额

    private BigDecimal businessFrozenAmount; //	N16.2	交易冻结份额

    private BigDecimal unpaidIncome; //	N16.2	未付收益金额

    private String protocolName; //组合名称

    // 净值
    private BigDecimal netValue;

    public void setNetValue(BigDecimal netValue) {
        this.netValue = netValue;
    }

    public BigDecimal getNetValue() {
        return this.netValue;
    }

    // 每日收益
    private BigDecimal todayIncome;

    public void setTodayIncome(BigDecimal todayIncome) {
        this.todayIncome = todayIncome;
    }

    public BigDecimal getTodayIncome() {
        return this.todayIncome;
    }

    // 日收益率
    private BigDecimal todayIncomeRate;

    public void setTodayIncomeRate(BigDecimal todayIncomeRate) {
        this.todayIncomeRate = todayIncomeRate;
    }

    public BigDecimal getTodayIncomeRate() {
        return this.todayIncomeRate;
    }

    // 基金名字
    private String fundName;

    public void setFundName(String fundName) {
        this.fundName = fundName;
    }

    public String getFundName() {
        return this.fundName;
    }

    // 净值日期
    private Date netValueDate;

    public void setNetValueDate(Date netValueDate) {
        this.netValueDate = netValueDate;
    }

    public Date getNetValueDate() {
        return this.netValueDate;
    }

    // 净值日期字符串 MM-dd
    public String getNetValueDateString() {
        if (this.netValueDate == null) {
            return "";
        }
        return DateUtils.formatDate7(this.netValueDate);
    }

    // 前端基金类型
    private int appFundType;

    public void setAppFundType(int appFundType) {
        this.appFundType = appFundType;
    }

    public int getAppFundType() {
        return this.appFundType;
    }

    // 市值
    private BigDecimal worthValue;

    public void setWorthValue(BigDecimal worthValue) {
        this.worthValue = worthValue;
    }

    public BigDecimal getWorthValue() {
        return this.worthValue;
    }

    // 万份之收益-10位小数
    private BigDecimal dailyProfit;

    public BigDecimal getDailyProfit() {
        return dailyProfit;
    }

    public void setDailyProfit(BigDecimal dailyProfit) {
        this.dailyProfit = dailyProfit;
    }

    // 万份之收益字符串-货币型基金
    public String getDailyProfitString() {
        if (dailyProfit == null) {
            dailyProfit = new BigDecimal(0);
        }
        return MoneyUtils.formatMoney(dailyProfit, 4);
    }

    // 本金
    private BigDecimal fundBalance;

    public void setFundBalance(BigDecimal fundBalance) {
        this.fundBalance = fundBalance;
    }

    public BigDecimal getFundBalance() {
        return this.fundBalance;
    }

    // 累计收益
    private BigDecimal accumIncome;

    public void setAccumIncome(BigDecimal accumIncome) {
        this.accumIncome = accumIncome;
    }

    public BigDecimal getAccumIncome() {
        return this.accumIncome;
    }

    // 持仓收益率
    private BigDecimal accumIncomeRate;

    public void setAccumIncomeRate(BigDecimal accumIncomeRate) {
        this.accumIncomeRate = accumIncomeRate;
    }

    public BigDecimal getAccumIncomeRate() {
        return this.accumIncomeRate;
    }

    // 基金类型
    private String fundType;

    public void setFundType(String fundType) {
        this.fundType = fundType;
    }

    public String getFundType() {
        return this.fundType;
    }

}
